package com.xbongbong.pro.enums.workbench;

import lombok.Getter;

/**
 *
 * 创建时间 2021/7/12 9:37 AM
 * 修改时间 2021/7/12 9:37 AM
 * @author chy
 */
@Getter
public enum WorkbenchPageEnum {


    CUSTOMER_LIST("customerList", "客户列表"),
    CONTACT_LIST("contactList", "联系人列表"),
    COMMUNICATE_LIST("communicateList", "跟进记录列表"),
    COMMUNICATE_PLAN_LIST("communicatePlanList", "访客计划列表"),
    CONTRACT_LIST("contractList", "合同订单列表"),
    PAYMENT_LIST("paymentList", "回款计划列表"),
    WORK_ORDER_LIST("workOrderList", "工单列表"),
    WORK_REPORT_LIST("workReportList", "工作报告列表"),
    /**
     * 图标中心，菜单第一个
     */
    SALES_BEHAVIOR_ANALYSIS("salesBehaviorAnalysis", "销售行为分析"),
    CONTRACT_PAYMENT_ANALYSIS("contractPaymentAnalysis", "合同回款分析"),
    CUSTOMER_ANALYSIS("customerAnalysis", "客户分析"),
    PERFORMANCE_PK("performancePK", "绩效PK"),
    /**
     * 首页销售简报跳转的页面
     */
    CUSTOMER_COUNT("customerCount", "今日新增客户"),
    FOLLOW_CUSTOMER_COUNT("followCustomerCount", "今日跟进客户"),
    CONTRACT_COUNT("contractCount", "今日合同订单"),
    CONTRACT_AMOUNT("contractAmount", "今日合同金额"),
    ;

    private String alias;

    private String name;

    WorkbenchPageEnum(String alias, String name) {
        this.alias = alias;
        this.name = name;
    }

    /**
     * 通过枚举<alias>alias</alias>获得枚举
     *
     * @param alias
     * @return WorkbenchPageEnum
     */
    public static WorkbenchPageEnum getByAlias(String alias) {
        if(alias == null) {
            return null;
        }
        for (WorkbenchPageEnum cacheCode : values()) {
            if (alias.equals(cacheCode.getAlias())) {
                return cacheCode;
            }
        }
        return null;
    }
}
